//
//  ViewController.h
//  HondaPro_2
//
//  Created by Eric on 13-5-29.
//  Copyright (c) 2013年 glendale. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "EGORefreshTableHeaderView.h"
#import "HeadView.h"
#import "popContentViewController.h"
#import "AppDelegate.h"
#import "SettingViewController.h"
@class LoginViewController;
@interface MainViewController : UIViewController<UITableViewDelegate,UITableViewDataSource,EGORefreshTableHeaderDelegate,HeadViewDelegate,ContentViewControllerDelegate,SettingViewDelegate>
{
    UITableView *_tbView;
    EGORefreshTableHeaderView *_refreshTableView;
    BOOL _reloading;
    
    NSInteger _currentSection;
    NSInteger _currentRow;
    NSMutableArray *_headViewDis;
    
    popContentViewController *contentCon;
    
    /*给工作台看板的section上添加按钮*/
    UIButton *_button1ForWorkBoard;
    UIButton *_button2ForWorkBoard;
    UIButton *_button3ForWorkBoard;
    bool _bFlagBtn1ForWorkBoard;
    bool _bFlagBtn2ForWorkBoard;
    bool _bFlagBtn3ForWorkBoard;
    
    //当前的工作台要显示的数据
    NSMutableArray *_arrCurrentPrecontractList;
    NSMutableArray *_arrCurrentMaintenanceList;
    NSMutableArray *_arrCurrentSettlementList;
}
//添加
@property (nonatomic, readonly) SettingView*    settingView;

@property(strong, nonatomic)UIPopoverController *popCon;
@property(nonatomic ,strong)UITextField *accoutName;
@property (nonatomic,retain) UIAlertView *myAlertView;
@property(nonatomic,strong)LoginViewController *logCon;

+ (MainViewController *)sharedViewController;
//开始重新加载时调用的方法
- (void)reloadTableViewDataSource;
//完成加载时调用的方法
- (void)doneLoadingTableViewData;

-(IBAction)serviceSelectBtn:(id)sender;
-(void)systemLogin;
- (IBAction)addServiceSelect:(id)sender;

/*add by mm*/
-(void)createTableHeadView;
-(void)resetTableView;
-(void)createArrowOnBtnByState:(BOOL)state OnHeadView:(HeadView *)view;
-(void)setUpFontAndColorForWorkBoardByCell:(UITableViewCell *)xingCanCell;
-(void)setUpPrecontractDisByCell:(UITableViewCell *)xingCanCell inRow:(NSInteger)xingCanRow;
-(void)setUpMantenceDisByCell:(UITableViewCell *)xingCanCell inRow:(NSInteger)xingCanRow;
-(void)setUpSettlementDisByCell:(UITableViewCell *)xingCanCell inRow:(NSInteger)xingCanRow;

//得到一个 HH:mm 时间格式 的时间 距离 当天凌晨的间隔，单位 s
-(NSTimeInterval)timeIntervalFrom0000ByTimeString:(NSString *)timeStr;
//得到当前时间的 HH:mm 时间格式 字符串
-(NSString *)currentTimeStrHHmm;
//获得当前的时间，时间格式：yyyy-MM-dd HH:mm
-(NSString *)currentTimeStryyyyMMDDHHmm;
//返回时间差值，时间格式为 yyyy-MM-dd HH:mm
-(NSTimeInterval)timeIntervalByFirstTimeStr:(NSString *)timeStrFirstly subcontractSecondTimeStr:(NSString *)timeStrSecondly;
/*end of add by mm*/


- (IBAction)sysSettingAction:(UIButton *)sender;

//注册消息
-(void)addAllObserver;
//移除消息
-(void)removeAllObserver;

//跳转到服务接待的界面，带入车牌号
-(void)switchToServiceUIByPlateNumber:(NSString *)plateNumberStrXingCan;
//跳转到预约查询的界面，带入车牌号
-(void)switchToPreContractUIByPlateNumber:(NSString *)plateNumberStrXingCan;
//进入结算界面，带入车牌号
-(void)switchToSettlementUIByPlateNumber:(NSString *)plateNumberStrXingCan;

/*
 给工作台看板的section上添加按钮
 UIButton *_button1ForWorkBoard;
 UIButton *_button2ForWorkBoard;
 UIButton *_button3ForWorkBoard;
 */
//按钮的回调方法
-(void)BtnOnHeadViewPressed:(UIButton *)btn;
//根据按钮的状态 给数组赋值
-(void)setUpArrValByBtnState;
//当前估价人的数量
-(NSInteger)currentPersonSumBySection:(NSInteger)sectionXingCan;
//全部的数量
-(NSInteger)allPersonSumBySection:(NSInteger)sectionXingCan;
//根据按钮的状态设置按钮的显示字符串
-(void)setUpBtnDisStr;




- (IBAction)onTapElearningButton:(UIButton *)sender;
// 走进广本
- (IBAction)onTapEnterShow:(id)sender;
// 本店优势
- (IBAction)onTapStoreShow:(id)sender;


//本田科技
- (IBAction)onTapTechnologyButton:(id)sender;

//品牌故事
- (IBAction)onTapBrandStoryButton:(id)sender;
@end
